using System.Collections;
using Rdl;

namespace GTame.ReportParser
{

    public class ReportItemsTypeComposite : System.Collections.Hashtable
    {

        public ReportItemsTypeComposite()
        {
        }

        public Rdl.ReportItemsType Write()
        {
            Rdl.ReportItemsType reportItemsType = new Rdl.ReportItemsType();
            System.Collections.ArrayList arrayList = new System.Collections.ArrayList();
            foreach (object obj in Values)
            {
                if ((obj as GTame.ReportParser.TextboxType))
                {
                    arrayList.Add(((GTame.ReportParser.TextboxType)obj).Write());
                }
                else
                {
                    if ((obj as GTame.ReportParser.ChartType))
                    {
                        arrayList.Add(((GTame.ReportParser.ChartType)obj).Write());
                        continue;
                    }
                    if ((obj as GTame.ReportParser.CustomReportItemType))
                    {
                        arrayList.Add(((GTame.ReportParser.CustomReportItemType)obj).Write());
                        continue;
                    }
                    if ((obj as GTame.ReportParser.ImageType))
                    {
                        arrayList.Add(((GTame.ReportParser.ImageType)obj).Write());
                        continue;
                    }
                    if ((obj as GTame.ReportParser.LineType))
                    {
                        arrayList.Add(((GTame.ReportParser.LineType)obj).Write());
                        continue;
                    }
                    if ((obj as GTame.ReportParser.ListType))
                    {
                        arrayList.Add(((GTame.ReportParser.ListType)obj).Write());
                        continue;
                    }
                    if ((obj as GTame.ReportParser.MatrixType))
                    {
                        arrayList.Add(((GTame.ReportParser.MatrixType)obj).Write());
                        continue;
                    }
                    if ((obj as GTame.ReportParser.RectangleType))
                    {
                        arrayList.Add(((GTame.ReportParser.RectangleType)obj).Write());
                        continue;
                    }
                    if ((obj as GTame.ReportParser.SubreportType))
                    {
                        arrayList.Add(((GTame.ReportParser.SubreportType)obj).Write());
                        continue;
                    }
                    if ((obj as GTame.ReportParser.TableType))
                        arrayList.Add(((GTame.ReportParser.TableType)obj).Write());
                }
            }
            reportItemsType.Items = arrayList.ToArray();
            arrayList = null;
            return reportItemsType;
        }

    } // class ReportItemsTypeComposite

}

